<link type="text/css" href="/admins/js/pagerView/pager-view.css" rel="stylesheet" />
<link type="text/css" href="/admins/js/jquery/css/ui-lightness/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
<script type="text/javascript" src="/admins/js/jquery/jquery-ui-1.8.20.custom.min.js"></script>
<script type="text/javascript" src="/admins/js/jquery/jquery.ui.datepicker-zh-CN.js"></script>
<script type="text/javascript" src="/admins/js/pagerView/pager-view.js"></script>

<div class="admin_nrtop">
<div class="ad_search">
    
    <form action="/admini/manageuser/uwaybills/"  method="get"  id="form1">
        <div style="padding:2px 0 0 20px; margin:2px;line-height: 36px;" id='sel'> 
            <div style="float: left;margin-right: 10px;">
            <label for="quick">快速搜索：</label><input type="text" id="quick" name="quick" value="<?php echo $this->quick; ?>" />
             <label for="quick">年份选择：</label><select id="years" name="years">
            <?php 
				for($i=2013;$i<=date('Y');$i++){?>
					<option value="<?php echo $i;?>" <?php if ($this->years == $i) { echo "selected";}?>><?php echo $i;?></option>
			 <?php		}?>
            </select>
            </div>
            <input type="submit" id="queryButton" name="queryButton" value="查询"/>
        </div>
    </form>
    
    
</div>
</div>
<div class="dataTable" style="clear: both;">
<style>
.dataTable table{margin-bottom: 10px;border-bottom: 1px solid red;padding-bottom: 10px;table-layout:fixed;}
.dataTable table td{ border:#ccc solid 1px; text-align:center; line-height:25px;}
.red{ color:red;}
</style>
<table width="100%">
<tr>
<td style="width:120px;overflow:hidden;">会员信息</td>
<?php 
	for($i=1;$i<=12;$i++){?>
		<td style="width:110px; overflow:hidden;"><?php echo $i;?>月</td>
<?php 
		}
?>
</tr>
</table>
        <?php
		$users = new Application_Model_DbTable_User();
		$array_month = array('01','02','03','04','05','06','07','08','09','10','11','12');
        if ($this->userlist) {
            foreach ($this->userlist as $value) {
					?>
                
	<table width="100%">
        <tr>
           <td style="width:120px;overflow:hidden;"><p><?php echo $value['storeno']; ?></p><p>总单数：<?php echo $value['num']; ?></p></td>
           <?php 
		   $userdetail = $users->getByUserId($value['userId'],$this->years);
		   foreach($array_month as $value){?>
               <td style="width:110px; overflow:hidden;" valign="top">
               <?php 
			   foreach ($userdetail as $values) {
				   if($values['month']==$this->years.'-'.$value){
				   ?>
				   <p>发单数：<span class="red"><?php echo $values['num']; ?></span></p>
				   <p>总金额：<br /><span class="red"><?php echo $values['money']; ?></span></p>
				<?php
				}           
				}
				?>
				</td>
                <?php
			}?>
         </tr>
 </table>                
        <?php
    }
}
?>
</div>
<div class="toolbar">
	<div style=" float:left; color:red;">会员总数：<?php echo $this->size;?></div>
    <?php echo $this->partial('paging.phtml', array("pages" => $this->userlistAll,"pamas"=>"quick=".$this->quick."&years=".$this->years)); ?>
</div>
